<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link href="${pageContext.request.contextPath}/resource/css/def/datatables/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resource/css/customTemplet.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resource/css/bootstrap-multiselect.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/resource/js/jquery/plugin/datatables/js/jquery.dataTables.js"></script>
<script src="${pageContext.request.contextPath}/resource/js/jquery/plugin/handlebars-v3.0.1.js"></script>
<script src="${pageContext.request.contextPath}/resource/js/bootstrap/js/bootstrap-multiselect.js"></script>

<title>源码生成器</title>
</head>

<body>
<!-- Header -->
<div id="header-wrapper">
  <header id="header" class="container">
    <!-- Nav -->
    <nav id="nav">
       <ul>
         <li class="current"><a href="#" onclick="toTableList();">源码生成</a></li>
         <li><a href="#" onclick="toCustomTemplet();">自定义模板</a></li>
       </ul>
    </nav>
  </header>
</div>

<!-- Main -->
<div id="main-wrapper">
  <div class="container">
    <div class="main">
      <table class="table-data">
          <thead>
            <tr>
              <td colspan="6">
                <div class="floatL">
                  <form class="form-inline" role="form">
                    <div class="form-group">
						<label>表名：</label>
						<input type="text" class="form-control input-sm" name="tableName" id="tableNameStr" placeholder="表名">
                    </div>
                  </form>
                </div>
                <div class="floatR">
                	<button type="button" class="btn btn-primary btn-sm" onclick="searchPageList();">查&nbsp;&nbsp;询</button>
                	<button type="button" class="btn btn-primary btn-sm" onclick="cleanSelect();">清&nbsp;&nbsp;空</button>
                </div>
              </td>
            </tr>
            <tr>
            </tr>
          </thead>
        </table>

        <table id="searchTable" width="100%" height="100%" class="display" cellspacing="0" >
			<thead>
				<tr>
					<th>表名</th>
					<th>状态</th>
					<th>作者</th>
					<th>生成时间</th>
					<th>操作</th>
				</tr>
			</thead>
		</table>
    </div>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style="width:1000px">
    <div class="modal-content">
      <div class="modal-header blue-bg">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h3 class="modal-title" id="myModalLabel">源码生成</h3>
      </div>
      <div class="modal-body" style="max-height:460px;overflow-y:scroll;">
        <div class="search-box">
          <form id="dataTableForm" class="form-horizontal" role="form">
          		<input type="hidden" id="uceDataId" name="uceDataId">
            <div class="form-group">
              <label class="col-sm-2 control-label no-padding-right">表名：</label>
              <div class="col-sm-3"><input type="text" name="tableName" id="tableName" class="form-control input-sm" placeholder="表名" readonly></div>
              <label class="col-sm-2 control-label no-padding-right">包名：</label>
              <div class="col-sm-3"><input type="text" name="packagePath" id="packagePath" class="form-control input-sm" placeholder="包名"></div>
            </div>
            <div class="form-group">
            	<label class="col-sm-2 control-label no-padding-right">类名：</label>
              		<div class="col-sm-3"><input type="text" name="className" id="className" class="form-control input-sm" placeholder="类名"></div>
              	<label class="col-sm-2 control-label no-padding-right">JSP路径：</label>
              		<div class="col-sm-3"><input type="text" name="jspPath" id="jspPath" class="form-control input-sm" placeholder="如：sys/sysStaffController"></div>
            </div>
            <div class="form-group">
              	<label class="col-sm-2 control-label no-padding-right">作者：</label>
              		<div class="col-sm-3"><input type="text" name="createUser" id="createUser" class="form-control input-sm" placeholder="作者"></div>
              	<label class="col-sm-2 control-label no-padding-right">模板类别：</label>
              		<div class="col-sm-3">
              			<select class="form-control input-sm" multiple="multiple" id="templetClassify"  name="templetClassify" >
						</select>
              		</div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label no-padding-right">输出路径：</label>
              <div class="col-sm-10">
                <label class="radio-inline">
                  <input type="radio" onclick="showText(1);" name="saveType" id="inlineRadio1" value="1" checked="checked"> 打包下载
                </label>
                <label class="radio-inline">
                  <input type="radio" onclick="showText(0);" name="saveType" id="inlineRadio2" value="0" > 本地生成
                </label>
                <label class="radio-inline">
                	<input type="text" name="savePath" id="savePath" style="width:400px;display:none;" class="form-control input-sm" placeholder="本地路径">
                </label>
              </div>
            </div>
          </form>
        </div>
        <table class="table-data">
          <thead>
            <tr>
              <th width="15%">字段名称</th>
              <th width="10%">数据类型</th>
              <th width="10%">是否主键</th>
              <th width="20%">注释</th>
              <th width="20%">显示名称</th>
              <th width="10%">台帐显示</th>
              <th width="10%">查询条件</th>
            </tr>
          </thead>
          <tbody id="columnList">
          </tbody>
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="button default" data-dismiss="modal">取消</button>
        <button type="button" onclick="createCodeSource();" class="button blue">源码生成</button>
      </div>
    </div>
  </div>
</div>
</body>
<script src="${pageContext.request.contextPath}/resource/js/frm/sys/tableCode.js"></script>
</html>